﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Autofac.Integration.Mvc;
using Dapper;
using DapperExtensions;
using Model.DB;

namespace Dal
{
    public partial class UserInfoDal
    {
        public UserInfo GetUserInfoByUsernamePassword(string username, string password)
        {
            using (var con=Con)
            {
                UserInfo userInfo = null;
                string sql = "select * " +
                             "from UserInfo " +
                             "where LoginName=@LoginName and LoginPassword=@LoginPassword ";
                userInfo= con.Query<UserInfo>(sql,new { LoginName =username, LoginPassword =password}).SingleOrDefault();

                return userInfo;
            }
        }
    }
}
